#include "macros.h"

struct DataEntry* getDataEntry(pos_t pos)
{
    return (struct DataEntry*)(tavm_tables[TID_DATA_MAP].start + pos);
}

struct DataEntry* readDataEntry(struct Agent_Var* agent)
{
    pos_t pos;
    pos = READ_CODE(agent,pos_t);
    return getDataEntry(pos);
}

void sendData(struct DataEntry* dest, struct DataEntry* src)
{
    MEMCPYE(dest,src,tavm_data_type_size[src->type]);
}

pos_t getDataAddr(struct DataEntry* de)
{
    return de->pos + tavm_tables[de->tid].start;
}
